package com.it.jzs.controller.admin;

import com.it.jzs.pojo.Custom;
import com.it.jzs.service.admin.AdminCustomService;
import com.it.jzs.vo.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("admin")
@CrossOrigin
public class AdminCustomController {

    @Resource
    private AdminCustomService adminCustomService;


    @GetMapping("custom")
    public Result<Object> selectAll() {
//         自定义表 ，查询就查询最新的记录  ，因为需要在后台自定义中，无id的查询，只能查询最近的那条记录
        Result<Object> result = adminCustomService.selectAll();
        return result;
    }

    @PutMapping("custom")
    public Result<Object> update(@RequestBody Custom custom) {
        Result<Object> result = adminCustomService.update(custom);
        return result;
    }
}
